

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>查看认证</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/template.css" media="all">
</head>
<body>

<form class="layui-form" action="">
<div class="layui-fluid layadmin-cmdlist-fluid">
  <div class="layui-row layui-col-space30">
      <div class="layui-col-md12 layui-col-sm12">
          <div class="layui-form-item">
              <label class="layui-form-label">姓名</label>
              <div class="layui-input-inline">
                  <input type="text" name="name" id="name"  lay-verify="required" value="{$res.name}" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">擅长类目</label>
              <div class="layui-input-inline">
                  <select name="category_id" id="category_id" lay-verify="required" lay-search="">

                      　 {foreach $cate_list as $vo}　
                         {if $vo.id==$res['category_id']}
                      　　　 <option selected value={$vo.id}>{$vo.name}</option>
                      {else}
                      <option  value={$vo.id}>{$vo.name}</option>
                      {/if}
                      　　{/foreach}

                  </select>
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">在线鉴宝</label>
              <div class="layui-input-inline">
                  <input type="number" name="price" id="price"  lay-verify="required" value="{$res.cost}" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">面对面鉴宝</label>
              <div class="layui-input-inline">
                  <input type="number" name="face_price" id="face_price" lay-verify="required" value="{$res.face_cost}" autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">介绍</label>
              <div class="layui-input-inline">
                  <textarea rows="15%" cols="80%" name="info" id="info"  lay-verify="required" autocomplete="off">{$res.info}</textarea>
              </div>
          </div>
              <div class="layui-form-item">
                  <div class="layui-input-block">
                      <button class="layui-btn" onclick="agree()">提交</button>
                  </div>
              </div>
      </div>
  </div>
</div>
</form>

  <script src="../../layuiadmin/layui/layui.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
  <script>
  layui.config({
    base: '../../layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index']);
  layui.use(['laypage', 'layer'], function(){
  var laypage = layui.laypage
  ,layer = layui.layer;
  
  //总页数低于页码总数
  laypage.render({
    elem: 'demo0'
    ,count: 50 //数据总数
  });
});
  //同意
  function agree(){
      event.preventDefault();
      var name =$("#name").val();
      var info =$("#info").val();
      var price =$("#price").val();
      var face_price = $("#face_price").val();
      var category_id = $("#category_id").val();
      $.ajax({
       url: "{:url('user/edit')}",
       data: {category_id:category_id,name: name,info: info,cost: price,face_cost: face_price},
       type: 'post',
       dataType: 'json',
       success: function (data) {
           layer.msg(data.msg);
           window.parent.location.reload();//刷新父页面
           var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
           parent.layer.close(index);

             }
       })
  }

  layui.use('form', function(){
      var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功

      //……

      //但是，如果你的HTML是动态生成的，自动渲染就会失效
      //因此你需要在相应的地方，执行下述方法来手动渲染，跟这类似的还有 element.init();
      form.render();
  });
  </script>
</body>
</html>